<%@page import="com.person.daoImpl.AdminDaoImpl"%>
<%@page import="java.util.Iterator"%>
<%@page import="java.text.SimpleDateFormat"%>
<%@page import="java.util.List"%>
<%@page import="com.person.vo.Article"%>
<%@ page language="java" contentType="text/html; charset=UTF-8"
    pageEncoding="UTF-8"%>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<%
	AdminDaoImpl adi = new AdminDaoImpl();
	List<Article> lists = adi.getArticleAll();

	SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
%>
<!DOCTYPE html>
<html>
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>主页</title>
    <link rel="stylesheet" href="/PersonalBlog/frontPages/css/index.css">
</head>
<body>

    <header class="size-header">
        <div class="image"><a href="/PersonalBlog/frontPages/index.jsp"><img src="img/akina.png" alt=""></a></div>
        <div class="menu">
            <div class="Secret-Menu">
                <div class="ulbox">
                    <ul>
                        <li><a href="/PersonalBlog/frontPages/index.jsp">首页</a></li>
                        <li><a href="">分类</a></li>
                        <li><a href="">更多</a></li>
                    </ul>
                </div>
                <i class="iconfont iconhanbao"></i>
            </div>
            
            <div class="search">
                <i class="iconfont iconsearch"></i>
            </div>
            <div class="account">
                <i class="iconfont icon1"></i>
            </div>
        </div>
    </header>

    <div id="page" class="site">
        <div class="center-part">
            <!-- 头像 -->
            <div class="headPortrait">
                <img src="img/timg.jpg" alt="">
            </div>
            <div class="synopsis">
                <p>我清醒到足以成为一个废人。</p>
            </div>
        </div>
        
        <div class="content">
            <!-- 顶部公告内容 -->
            <div class="notice">
                <i class="iconfont iconyezi"></i>
                <p>站在巨人的肩膀上，我们渺小到不可一世。</p>
            </div>
            <div class="focalize">
                <h2>聚焦</h2>
                <div class="boxContent"><a href="#"><img src="img/timg.jpg" alt=""></a></div>
                <div class="boxContent"><a href="#"><img src="img/timg.jpg" alt=""></a></div>
                <div class="boxContent"><a href="#"><img src="img/timg.jpg" alt=""></a></div>
            </div>

            <div class="recent">
                <h2>近况</h2>
                
			<%
				for(int i = lists.size() - 1; i >= 0; i--){
					Article arti = lists.get(i);
			%>
			
                	<!-- 重复模块 -->
                <div class="post-entry">
                    <!-- 头像 -->
                    <div class="headPortrait">
<!--                         <img src="img/timg.jpg" alt=""> -->
                    </div>
                    <div class="textCont">	
                        <h2 class="title"><a href="/PersonalBlog/artiskip?id=<%=arti.getId()%>"><%=arti.getTitle() %></a></h2>
                        <div class="date"> <i class="iconfont iconshijian"></i> <%=sdf.format(arti.getDate()) %></div><!-- 文章的发布时间 -->
                        <div class="partContent"><p><%=arti.getDecrip() %></p></div><!-- 文章描述文字 -->
                    </div>

                    <div class="info">
                        <div class="pageView">
                            <i class="iconfont iconliulan"></i>
                            2020 热度
                        </div>
                        <div class="coment">
                            <i class="iconfont iconxinxi"></i>
                            102 评论
                        </div>
                    </div>
                </div>
            <%
            	}
			%>
              
            </div>
        </div>
    </div>

    <script src="/PersonalBlog/frontPages/js/index.js"></script>
</body>
</html>